🎖️GitЯра🎖️
core/navigation/README.md 4d4070c8e1ed73a56ee2f054300a0f62e3fe2e62 (4d4070c8) Text, 2.57 KB
Tc9d1d9# `:core:navigation`
Tc9d1d9## Overview
The Ta5d6ff`:core:navigation` module defines the type-safe Navigation 3 route model for Android and Desktop using Kotlin Serialization.
Tc9d1d9## Key Components
Tc9d1d9### 1. `Routes.kt`
Contains serializable Ta5d6ff`NavKey` route classes/objects used by shared feature graphs.
Tc9d1d9### 2. `DeepLinkRouter.kt`
Parses Meshtastic deep-link URIs and synthesizes a typed backstack (for example Ta5d6ff`/nodes/1234/device-metrics`).
Tc9d1d9### 3. `NavigationConfig.kt`
Defines Ta5d6ff`MeshtasticNavSavedStateConfig` using sealed interface hierarchies so Navigation 3 backstacks can be persisted/restored safely — new routes are auto-registered at compile time.
Tc9d1d9## Features
Tff7b72- **Type-Safety**: Uses serializable Ta5d6ff`NavKey` routes instead of ad-hoc string routes.
Tff7b72- **Deep-link synthesis**: Converts incoming URIs into typed backstacks via Ta5d6ff`DeepLinkRouter`.
Tff7b72- **Centralized definition**: Routes and saved-state serializers are declared in one place to avoid feature-module cycles.
Tc9d1d9## Usage
Feature modules depend on this module to define their entry points and navigate via Ta5d6ff`NavBackStack<NavKey>`.
Ta5d6ff```Ta5d6ffkotlin
Tff7b72import T7ee787androidx.navigation3.runtime.NavBackStack
Tff7b72import T7ee787androidx.navigation3.runtime.NavKey
Tff7b72import T7ee787org.meshtastic.core.navigation.NodesRoute
Tff7b72fun Td2a8ffopenNodeDetailTb4b4b4(Te6edf3backStackTb4b4b4: Te6edf3NavBackStackTff7b72<Te6edf3NavKeyTff7b72>Tb4b4b4, Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4) Tb4b4b4{
Te6edf3backStackTb4b4b4.Te6edf3addTb4b4b4(Te6edf3NodesRouteTb4b4b4.Te6edf3NodeDetailTb4b4b4(Te6edf3destNumTb4b4b4)Tb4b4b4)
Tb4b4b4}
Ta5d6ff```
Tc9d1d9## Dependency Graph
<!--region graph-->
Ta5d6ff```Ta5d6ffmermaid
Ta5d6ffgraph TB
:core:navigation[navigation]:::kmp-library-compose
:core:navigation -.-> :core:common
:core:navigation -.-> :core:resources
:core:navigation -.-> :core:testing
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
Ta5d6ff```
<!--endregion-->
Served by rngit 1.5.2 - Generated in 0.06s